<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>art</title>
    <script src="https://unpkg.com/htmx.org@1.9.6"></script>
</head>

<body>
    123456
    <div id="article-container" hx-trigger="load" hx-swap="innerHTML" style="min-height: 200px;">
        <!-- 加载中提示（请求完成前显示） -->
        <div style="text-align: center; padding: 40px; color: #666;">
            加载中...
        </div>
    </div>
    <script>

        const queryParams = new URLSearchParams(window.location.search);
        const id = queryParams.get('id');
        // 使用 hx-get 属性将数据加载到 #article-container 元素中
        document.getElementById('article-container').setAttribute('hx-get', `http://localhost:3000/api/article-detail?id=${id}`);
    </script>
</body>

</html>